//global
fis.set('project.charset','utf-8');
fis.set('project.ignore', ['node_modules/**', 'output/**', '.git/**', 'fis-conf.js', 'dist/**', 'product/**', '**/_*.{scss,sass}', '*.bat']);
// fis.set('project.exclude', '**/_*.css');
fis.set('pure.cssfrefix', ["Android >= 2.3", "ChromeAndroid > 1%", "iOS >= 4"]);

//global setting
fis.match('/src/(**.html)', {
  release: '/html/$1'
})
.match('/src/scss/(**.{scss,sass})', {
  postprocessor: fis.plugin('autoprefixer', {
    'browsers': fis.get('pure.cssfrefix')
  }),
  rExt: 'css',
  release: '/css/$1'
})
.match('/src/scripts/(**.js)', {
  release: '/js/$1'
})
.match('/src/scripts/({lib/**.js,public/**.js})',{
  optimizer: null,
})
.match('/src/images/(**.{jpg,png})', {
  release: '/images/$1$2'
});


//development default
fis
.media('dev')
.match('/src/scss/**.{sass,scss}', {
  //启用SourceMaps
  parser: fis.plugin('sass', {
    sourceMap: true,
    sourceMapEmbed: true
  })
});


//deploy
fis
.media('deploy')
.match('/src/scss/(**.{scss,sass})', {
  parser: fis.plugin('sass', {
    outputStyle: 'nested',
    sourceMap: true
  }),
  release: '/css/$1'
});

//product 1.文件指纹 2.png压缩 3.css和html压缩 4.js混淆
fis
.media('prd')
.match('*.{js,jpg,png,css}', {
  useHash: true
})
.match('/src/(**.html)', {
  optimizer: fis.plugin('html-minifier'),
})
.match('/src/scss/(**.{scss,sass})', {
  parser: fis.plugin('sass', {
    outputStyle: 'compressed'
  }),
})
.match('/src/scripts/(**.js)',{
  optimizer: fis.plugin('uglify-js'),
})
.match('/src/images/(**.png)', {
  optimizer: fis.plugin('png-compressor', {
    type: 'pngquant'
  })
});

